package com.kma.summer2012.client.events.request;

import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent;

/**
 * Created with IntelliJ IDEA.
 * User: EUGENE
 * Date: 2/19/13
 * Time: 11:24 PM
 * To change this template use File | Settings | File Templates.
 */
public class FindRequestEvent extends GwtEvent<FindRequestEvent.FindRequestEventHandler> {
    private static Type<FindRequestEventHandler> TYPE = new Type<FindRequestEventHandler>();
    public String id;

    public FindRequestEvent(String id) {
        this.id = id;
    }

    @Override
    public Type<FindRequestEventHandler> getAssociatedType() {
        return TYPE;
    }

    public static Type<FindRequestEventHandler> getType() {
        return TYPE;
    }

    @Override
    protected void dispatch(FindRequestEventHandler importRequestEventHandler) {
        importRequestEventHandler.onFindRequest(this.id);
    }

    public interface FindRequestEventHandler extends EventHandler {
        void onFindRequest(String id);
    }
}
